package com.dhecp.project.storage.service.impl;

import com.dhecp.project.storage.domain.HwReconcileSon;
import com.dhecp.project.storage.mapper.HwReconcileSonMapper;
import com.dhecp.project.storage.service.HwReconcileSonService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.dhecp.core.constant.DataFiltering;
import com.dhecp.project.system.service.SysDictionaryForFieldService;
import java.util.List;
import java.util.Map;

/**
 * 入库对账信息(HwReconcileSon表)服务实现类
 *
 * @author fxz
 * @since 2024-03-01 10:23:00
 */
@Service("hwReconcileSonService")
public class HwReconcileSonServiceImpl implements HwReconcileSonService {
    @Autowired
    private HwReconcileSonMapper hwReconcileSonMapper;
    
    @Autowired
    private SysDictionaryForFieldService dictionaryForFieldService;
    /**
    * 查询列表数据
    */
    @Override
    public List<HwReconcileSon> queryList(Map<String, Object> params) throws Exception{
        params.put(DataFiltering.TABLE_ALIAS, "t1");	//查询表别名
        params.put(DataFiltering.DATA_WHERE, dictionaryForFieldService.getWhereStr(params));	//常规查询条件SQL语句
        params.put(DataFiltering.DATA_SCODE, dictionaryForFieldService.getDataScode(params));	//数据权限查询条件SQL语句
        return this.hwReconcileSonMapper.select(params);
    }
    
    /**
     * 通过guid查询单条数据
     *
     * @param params 对象
     * @return 实例对象
     */
    @Override
    public HwReconcileSon queryFirstRecord(Map<String, Object> params) throws Exception{
        params.put(DataFiltering.TABLE_ALIAS, "t1");	//查询表别名
        params.put(DataFiltering.DATA_SCODE, dictionaryForFieldService.getDataScode(params));	//数据权限查询条件SQL语句
        return this.hwReconcileSonMapper.selectFirstRecordByNid(params);
    }
    
        /**
     * 通过PBid删除主表信息
     * @param pBid 对象
     * @return 实例对象
     */
    @Override
    public void deletePBid(String pBid) throws Exception {
        this.hwReconcileSonMapper.deletePBid(pBid);
    }
}

